#!/usr/bin/make -f

%:
	dh ${@}


override_dh_auto_build:
	# Remove Electron bundle
	jq 'del(.dependencies.electron)' package.json > package.json.tmp && mv package.json.tmp package.json
	jq 'del(.devDependencies."electron-builder")' package.json > package.json.tmp && mv package.json.tmp package.json
	
	# Build
	npm_config_cache=./npm_cache npm install --ignore-scripts --no-shrinkwrap
	npm prune --production
	cp artifacts/onenote-icon-2019/1024x1024.png p3x-onenote.png
	
	# Delete unused files
	rm -f node_modules/*/{CHANGELOG.md,README.md,README,readme.md,readme}
	rm -rf node_modules/.cache

